#include"functions.h"

using namespace std;

int main()
{
  int n = 3;
  double** A = new double*[n];
  for(int i = 0; i < n; i++)
    A[i] = new double[n]();
  A[0][n-1] = -3.0;
  A[1][n-1] = 5.0;
  A[2][n-1] = -1.0;
  for(int i = 1; i < n; i++)
    A[i][i-1] = 1.0;
  EigenvaluePower(A,pow(10,-8),n);
  A[0][n-1] = 1.0;
  A[1][n-1] = 3.0;
  A[2][n-1] = 0.0;
  EigenvaluePower(A,pow(10,-8),n);
  for(int i = 0; i < n; i++)
    delete [] A[i];
  delete [] A;
  n = 8;
  A = new double*[n];
  for(int i = 0; i < n; i++)
    A[i] = new double[n]();
  A[7][n-1] = -101.0;
  A[6][n-1] = -208.01;
  A[5][n-1] = -10891.01;
  A[4][n-1] = -9802.08;
  A[3][n-1] = -79108.9;
  A[2][n-1] = 99902.0;
  A[1][n-1] = -790.0;
  A[0][n-1] = 1000.0;
  for(int i = 1; i < n; i++)
    A[i][i-1] = 1.0;
  EigenvaluePower(A,pow(10,-8),n);
  for(int i = 0; i < n; i++)
    delete [] A[i];
  delete [] A;
  return 0;
};
